﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace teach
{
    public class Baseball : Question, ITextQuestion
    {
        public string QuestionText { get; set; }

        public Baseball()
        {
            m_message = "National Pastime";
        }

        public override object Answer
        {
            get
            {
                return Properties["answer"];
            }
        }

        public override bool CheckAnswer(object userAnswer)
        {
            bool success = (userAnswer.ToString().ToLower().Trim() == Answer.ToString().ToLower());
            if (success == false && Properties.ContainsKey("answer2"))
            {
                success = (userAnswer.ToString().Trim().ToLower() == Properties["answer2"].ToString().ToLower());
            }
            return success;
        }

        public override void GenerateValues(Preference pref)
        {
            this.Timeout = pref.Timeout * 1000;
            QuestionText = Properties["question"];
        }
    }
}
